package com.example.zhunongzonghe.enums;

import lombok.Getter;

@Getter
public enum FarmCollectStatusEnum {
    COLLECT(1,"收藏"),
    UN_COLLECT(0,"未收藏");
    public int code;
    public String desc;

    FarmCollectStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static FarmCollectStatusEnum getByCode(int code) {
        for (FarmCollectStatusEnum postCollectStatusEnum : FarmCollectStatusEnum.values()) {
            if (postCollectStatusEnum.code == code) {
                return postCollectStatusEnum;
            }
        }
        return null;
    }
}
